package com.cj.designpattern.adapter;

import com.cj.designpattern.adapter.common.IVoltage5;
import com.cj.designpattern.adapter.common.Voltage220;

/**
 * ClassName: ClassVoltageAdapter <br/>
 * Function: 完成220V-5V的转变 类适配器<br/>
 * date: 2018/04/28 9:22 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public class ClassVoltageAdapter extends Voltage220 implements IVoltage5 {

    @Override
    public int outPut5V() {
        int src = outPut220V();
        System.out.println("适配器工作开始适配电压");
        int dst = src / 44;
        System.out.println("适配完成后输出电压：" + dst);
        return dst;
    }
}
